<?php


namespace App\Common;
use App\DemandSensitiveWord;

/**
 * 检测是否含有敏感词
 * Date: 17/1/15
 * Time: 下午1:06
 */
class DemandSW {
    public static function haveSV($words) {
        $count = DemandSensitiveWord::whereRaw("? like concat('%', badword, '%')", array($words))->count();
//        return $count;
        return 0;
    }

    public static function showSV($words) {
        $baword = DemandSensitiveWord::whereRaw("? like concat('%', badword, '%')", array($words))->first();
        return $baword;
    }
}